﻿/**************************************************************************
创建时间:	2019/5/23
作	  者:	张存
邮 	  箱:	zhangcunliang@126.com

Copyright (c) zhcun.cn

描	述：
记	录：
***************************************************************************/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Windows.Forms.Design;

namespace ASmile.Win.Controls
{
    [ToolStripItemDesignerAvailability(ToolStripItemDesignerAvailability.ToolStrip)]
    public class ToolStripEditNumber : ToolStripControlHost
    {
        public ToolStripEditNumber()
            : base(new EditNumber())
        { }

        [Description("文本框控件")]
        public EditNumber EditControl
        {
            get
            {
                return Control as EditNumber;
            }
        }

        /// <summary>
        /// 空字符提示文本
        /// </summary>
        [Description("格式化字符")]
        public string FormatString
        {
            get
            {
                return EditControl.FormatString;
            }
            set
            {
                EditControl.FormatString = value;
            }
        }

        /// <summary>
        /// 数字前缀字符 如金额显示的：￥
        /// </summary>
        [Description("数字前缀字符，如金额显示的：￥")]
        public string PrefixSign
        {
            get
            {
                return EditControl.PrefixSign;
            }
            set
            {
                EditControl.PrefixSign = value;
            }
        }

        /// <summary>
        /// 数字值
        /// </summary>
        [Description("数字值")]
        public decimal Value
        {
            get
            {
                return EditControl.Value;
            }
            set
            {
                EditControl.Value = value;
            }
        }

        public new HorizontalAlignment TextAlign
        {
            get => EditControl.TextAlign;
            set => EditControl.TextAlign = value;
        }
    }
}